<?php 

require "../gobal.php";




$customer=currCustomer();
$cid=$customer["id"];
$sql="select count(id) as c from order_sum where customer_id=$cid";

//$rows=fetch_rows($sql);


$sql="select count(id) as c,sum(pay_total_fee) as p from order_sum_detail where customer_id=$cid";

$rows=fetch_rows($sql);

$orderCount=$rows[0]["c"];
$sumPrice=$rows[0]["p"];

?>

<div class="navbar noborder">
  <div class="navbar-inner">
    <div class="left sliding"><a href="index.php" class="no-animation link"><i class="icon icon-home"></i></a></div>
    <div class="center sliding">个人中心</div>
    <!--<div class="right"><a href="/UserRecharge" class="link icon-only btn-border">充值</a></div> -->
  </div>
</div>
<div class="pages navbar-through">
  <div data-page="accordion" class="page">
    <div class="page-content">


        <div class="usercenter-top">
            <div class="userface"><img src="<?php echo $customer["wxmp_headimgurl"]; ?>" /></div>
            <div class="usernick"><?php echo $customer["wxmp_nickname"]; ?></div>
        </div>
        <div class="usercenter-btns">
            <a href="#" class="btns-item click-active"><span class="title">订单数</span><span class="subtitle"><?php echo $orderCount;  ?></span></a>
            <a href="#" class="btns-item click-active"><span class="title">共消费</span><span class="subtitle">￥<?php echo $sumPrice/100;  ?></span></a>
			<!--
            <a href="#" class="btns-item click-active"><span class="title">余额</span><span class="subtitle">0.0</span></a>
            -->
</div>




            <div class="list-block user-menu-list">
                <ul>

                  <li>
                    <a href="customer/order-history.php" class="item-link" data-ignore-cache="true">
                      <div class="item-content">
                        <div class="item-media"><i class="mainpic icon-user-1"></i></div>
                        <div class="item-inner"><div class="item-title">我的维修订单</div></div>
                      </div>
                    </a>
                  </li>
				  
				  <!--
				  <li>
                    <a href="javascript:void" onclick="location_to('payment/orderquery.php')" class="item-link" data-ignore-cache="true">
                      <div class="item-content">
                        <div class="item-media"><i class="mainpic icon-user-1"></i></div>
                        <div class="item-inner"><div class="item-title">微信支付记录</div></div>
                      </div>
                    </a>
                  </li>
                  -->

                </ul>
              </div>


              <div class="list-block user-menu-list">
                <ul>

                  <li>
                    <a href="customer/contact-select.php" class="item-link" data-ignore-cache="true">
                      <div class="item-content">
                        <div class="item-media"><i class="mainpic icon-user-4"></i></div>
                        <div class="item-inner"><div class="item-title">管理上门地址</div></div>
                      </div>
                    </a>
                  </li>

					
					<!--
                  <li>
                    <a href="/UserCoupon" class="item-link" data-ignore-cache="true">
                      <div class="item-content">
                        <div class="item-media"><i class="mainpic icon-user-5"></i></div>
                        <div class="item-inner"><div class="item-title">我的优惠码</div></div>
                      </div>
                    </a>
                  </li>

                  <li>
                    <a href="/UserTakeCash" class="item-link" data-ignore-cache="true">
                      <div class="item-content">
                        <div class="item-media"><i class="mainpic icon-user-6"></i></div>
                        <div class="item-inner"><div class="item-title">账户提现</div></div>
                      </div>
                    </a>
                  </li>
                  -->

                </ul>
              </div>
















    </div>
  </div>
</div>
